package mornd.extend.test6;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * @author: mornd
 * @dateTime: 2023/5/11 - 21:33
 */

@Component
public class Bean1  {
    protected Bean2 bean2;
    protected boolean flag;

    @Autowired
    public void setBean2(Bean2 bean2) {
        System.out.println("setBean2...");
        this.bean2 = bean2;
    }

    @PostConstruct
    private void init() {
        flag = true;
        System.out.println("init...");
    }

    public Bean2 getBean2() {
        return bean2;
    }

    public boolean isFlag() {
        return flag;
    }
}
